export default () => {
  // 注入外部脚本
  const externalScript = document.createElement('script');
  externalScript.src = 'https://www.googletagmanager.com/gtag/js?id=AW-11498410870';
  externalScript.async = true;
  document.head.appendChild(externalScript);

  // 注入内联脚本
  const inlineScript = document.createElement('script');
  inlineScript.textContent = `
      window.dataLayer = window.dataLayer || []; 
      function gtag(){dataLayer.push(arguments);} 
      gtag('js', new Date()); 
      gtag('config', 'AW-11498410870');
      gtag('config', 'G-7V3QXPYC6K');
    `;
  document.head.appendChild(inlineScript);
};
